package com.szholly.pro.watergas_server.ps.data;

import java.util.HashMap;

import com.szholly.data.general.metadata.table.DefulatDomainTable;import org.springframework.stereotype.Component;import com.szholly.data.general.Field;import com.szholly.data.general.InterceptorTableBase;import com.szholly.data.general.metadata.IBaseTable;import com.szholly.utils.spring.SpringBeanFactory;import org.springframework.stereotype.Component;import com.szholly.data.general.GlobalDataType;import com.szholly.data.general.RowBase;import com.szholly.data.general.metadata.table.DefulatDomainTable;

/**
 * OperationTaskConfig
 */
@Component("OperationTaskConfig")
public class OperationTaskConfigTable extends InterceptorTableBase  implements IBaseTable{

	public final static String TABLE_NAME = "OC_TASK_CONFIG";
	
	/**
	 * single ref
	 */
	public static OperationTaskConfigTable getSingleRef() {
		return (OperationTaskConfigTable) SpringBeanFactory.getBean("OperationTaskConfig");
	}

	@Override
	public String getMetadataTableName() {
		return TABLE_NAME;
	}

	@Override
	public String getMetadataTableAliasName() {
		return "OperationTaskConfig";
	}

	private HashMap<String, Field> fields;

	@Override
	protected HashMap<String, Field> fields() {
		if (fields == null) {
			fields = new HashMap<String, Field>();

			Field itemField = new Field();
			itemField.setFieldName(RowBase.FIELD_GUID);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(1);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_JobId);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(5);
			itemField.setFieldAliasName("JOB_ID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_TaskTolerance);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(6);
			itemField.setFieldAliasName("时间容限");
			itemField.setCodeTablePK(DefulatDomainTable.TABLE_NAME);
			itemField.setCodeDomainName("OPERATION_TOLERANCE_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_LastTaskFinishTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(7);
			itemField.setFieldAliasName("LAST_TASK_FINISH_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_Guid);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("GUID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_EFFECTIVE_TIME);
			itemField.setDataType(GlobalDataType.Date);
			itemField.setFieldID(8);
			itemField.setFieldAliasName("生效时间");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_TaskCycle);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(9);
			itemField.setFieldAliasName("任务周期");
			itemField.setCodeTablePK(DefulatDomainTable.TABLE_NAME);
			itemField.setCodeDomainName("OPERATION_CYCLE_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_ParmId);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(10);
			itemField.setFieldAliasName("PARM_ID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_StationId);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(11);
			itemField.setFieldAliasName("STATION_ID");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_CurrentTaskCode);
			itemField.setDataType(GlobalDataType.String);
			itemField.setFieldID(12);
			itemField.setFieldAliasName("CURRENT_TASK_CODE");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_ScheduleStartTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(13);
			itemField.setFieldAliasName("SCHEDULE_START_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
			
			itemField = new Field();
			itemField.setFieldName(OperationTaskConfigRow.FIELD_CurrentTaskStartTime);
			itemField.setDataType(GlobalDataType.DateTime);
			itemField.setFieldID(14);
			itemField.setFieldAliasName("CURRENT_TASK_START_TIME");
			itemField.setCanShow(false);
			fields.put(itemField.getFieldName().toUpperCase().trim(), itemField);
		}
		return fields;
	}

	@Override
	public String getTableGroup() {
		return "OperationTaskConfig";
	}
}